home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 43 / 043.d81 / sector editor (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  19KB  |  815 lines

  1. 0 rem *********************************
  2. 1 rem ** video ventures disk editor! **
  3. 2 rem **       copyright  1987       **
  4. 3 rem **                             **
  5. 4 rem **   programmed by shawn ort   **
  6. 5 rem *********************************
  7. 6 poke53280,12:poke53281,12:poke646,0
  8. 8 poke650,128
  9. 9 print"[147]";chr$(9);chr$(8);
  10. 10 print"             [211][197][195][212][207][210] [197][196][201][212][207][210]"
  11. 15 print"        [194][217] [211][200][193][215][206] [207][210][212]   ([195]) 1987"
  12. 20 print"                                 [146]"
  13. 22 print"              1. [197][196][201][212] [196][201][211][203]   [144]    [146]"
  14. 24 print"              2. [196][201][210][197][195][212][207][210][217]   [144]    [146]"
  15. 26 print"              3. [194][207][207][212] [196][201][211][203]   [144]   [146]"
  16. 28 print"                                 [146]"
  17. 30 print"      [161]                          [146][161]"
  18. 32 print"      [161]   [192][178][192]       [192][178][192]    [192][178][192]   [146][161]"
  19. 34 print"      [161]    [173][174]        [173][174]    [176][189]    [146][161]"
  20. 36 print"      [161]     [173][174]        [173][174]  [176][189]     [146][161]"
  21. 38 print"      [161]      [173][174]        [173][174][176][189]      [146][161]"
  22. 40 print"      [161]       [173][174]        [171][189]       [146][161]"
  23. 42 print"      [161]        [173][174]      [176][189]        [146][161]"
  24. 44 print"      [161]         [173][174]    [176][189]         [146][161]"
  25. 46 print"      [161]          [173][174]  [176][189]          [146][161]"
  26. 48 print"      [161]           [173][174][176][189]           [146][161]"
  27. 50 print"      [161]            [173][189]            [146][161]"
  28. 52 print"      [161]                          [146][161]"
  29. 53 print"[144]"
  30. 55 mn$(1)="   1. [197][196][201][212] [196][201][211][203]   [144]"
  31. 56 mn$(2)="   2. [196][201][210][197][195][212][207][210][217]   [144]"
  32. 57 mn$(3)="   3. [194][207][207][212] [196][201][211][203]   [144]"
  33. 58 c=1
  34. 59 print"":rem print down
  35. 60 forx=1to3
  36. 61 ifx=cthen print tab(11);"[158]";mn$(x):goto63
  37. 62 print tab(11);"";mn$(x)
  38. 63 nextx
  39. 64 get a$:ifa$=""then64
  40. 65 ifa$="[145]"then69
  41. 66 ifa$=""then71
  42. 67 ifa$=chr$(13)ora$="1"ora$="2"ora$="3"then75
  43. 68 goto64
  44. 69 ifc=1thenc=3:goto59
  45. 70 c=c-1:goto59
  46. 71 ifc=3thenc=1:goto59
  47. 72 c=c+1:goto59
  48. 75 rem goto routine
  49. 76 poke781,23:sys59903:ifa$="1"then100
  50. 77 ifa$="2"then1000
  51. 78 ifa$="3"then90
  52. 80 ifc=1then100
  53. 81 ifc=2then1000
  54. 82 ifc=3then90
  55. 83 run
  56. 90 rem ** boot disk **
  57. 91 print"[147]  [193]re you sure you want to quit? ([217]/[206])"
  58. 92 geta$:ifa$=""then92
  59. 93 ifa$<>"y"anda$<>"[217]"thenrun
  60. 94 open15,8,15,"r:hello connect=hello connect":poke646,12
  61. 95 input#15,a$:close15:print"":ifa$="63"then98
  62. 96 open15,8,15,"i0":close15:print"[144][201]nsert [204][207][193][196][211][212][193][210] disk!":forx=1to1500:next
  63. 97 goto90
  64. 98 print"load"chr$(34);"hello connect";chr$(34)",8,1[145][145][145]"
  65. 99 poke631,13:poke632,82:poke633,85:poke634,78:poke635,13:poke198,5:end
  66. 100 rem *******************************
  67. 105 rem **  start of editor program  **
  68. 110 rem *******************************
  69. 115 rem
  70. 120 print"[144][197]nter [212]rack:";:gosub1500:ift<>99then122
  71. 121 gosub5000:goto120
  72. 122 printchr$(9):ift=0thent=18:s=0
  73. 124 print"[147]";chr$(14):gosub125:goto225
  74. 125 rem ** read block **
  75. 126 if t<0 or t>41thenreturn
  76. 127 if s>20thenreturn
  77. 130 gosub2200:open15,8,15:open2,8,2,"#"
  78. 131 j=128:gosub600:gosub155
  79. 132 print#15,"m-r"chr$(0)chr$(3)chr$(255)
  80. 135 sys49152:rem read and store 1
  81. 140 print#15,"m-r"chr$(224)chr$(3)chr$(255)
  82. 145 sys49310:rem read and store 2
  83. 150 close2:gosub2000:close15:sys49447
  84. 155 print"";:forx=1to8:print"   [181]";tab(36);"[182]":nextx
  85. 160 print"   [183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]":return
  86. 165 rem ** edit and save **
  87. 168 gosub400
  88. 170 print"[144][212]rack";t;"[157] [211]ector";s;"[157]  ":print""
  89. 172 print"[206]ext track & sector    ";peek(1028);",";peek(1029)
  90. 173 print"[208]ress: [198]1[146] to exit without writing"
  91. 174 print"       [198]3[146] to edit in assembly"
  92. 175 print"       [198]7[146] to edit in hex or decimal"
  93. 176 print"[144][208]ress [210][197][212][213][210][206] [144]when ready to write sector";
  94. 179 sys49616
  95. 180 p=peek(254):wait207,1:poke204,1:poke198,0
  96. 181 ifp=13then194
  97. 182 ifp=133then190
  98. 183 ifp=134then40000
  99. 184 ifp=136then800
  100. 185 goto179
  101. 190 rem ** exit **
  102. 192 print"[147]":sys49447:poke199,0:gosub155:goto225
  103. 194 rem ** save **
  104. 195 gosub400:poke199,0:poke204,1:sys49342
  105. 196 print"[144][146]                      ";t;",";s:tt=t:ss=s
  106. 198 input"[146][145]save at track, sector";t,s
  107. 199 if t=tt then ifs=ssthen204
  108. 200 print"save at track";t;"sector";s:print"are you sure?"
  109. 201 geta$:ifa$=""then201
  110. 202 ifa$="y"ora$="[217]"then204
  111. 203 ifa$="n"ora$="[206]"thent=tt:s=ss:goto195
  112. 204 gosub2200:open2,8,2,"#":open15,8,15:print#15,"b-p:"2;0
  113. 205 sys49592
  114. 210 print#15,"u2:"2;0;t;s
  115. 215 gosub2100:close2:close15:print"[147]":gosub130:goto225
  116. 220 rem
  117. 225 rem ** sub-menu
  118. 230 print""
  119. 235 print"[211]-[211]elect track, sector  [197]-[197]dit sector"
  120. 240 print"[198]-[198]orward               [194]-[194]ackward"
  121. 245 print"[193]-[193]uto mode             [204]-[204]ock/unlock"
  122. 246 print"[208]-[208]rint contents        [200]-[200]eader info"
  123. 247 print"[206]-[206]ext track, sector    [216]-[197]xit"
  124. 250 print"[144][212]rack";t;"[157] [211]ector";s;"[157]  ":print""
  125. 251 print"[206]ext [212]rack, [211]ector        [157][157][157][157][157][157][157][157]";peek(1028);peek(1029);"    "
  126. 252 geta$:ifa$=""then252
  127. 257 ifa$=""then252
  128. 258 ifa$="s"ora$="[211]"then115
  129. 260 ifa$="e"ora$="[197]"then165
  130. 265 ifa$="f"ora$="[198]"thengosub300:if e<>1thensys49436:gosub155
  131. 270 ifa$="b"ora$="[194]"thengosub340:if e<>1thensys49436:gosub155
  132. 275 ifa$="a"ora$="[193]"then500
  133. 280 ifa$="x"ora$="[216]"then run
  134. 281 ifa$="n"ora$="[206]"thengosub450
  135. 282 ifa$="p"ora$="[208]"then700
  136. 283 ifa$="l"ora$="[204]"then750
  137. 284 ifa$="h"ora$="[200]"then1100
  138. 285 ifa$="+"thentt=t:t=t-1:gosub3000
  139. 286 ifa$="-"thentt=t:t=t+1:gosub3000
  140. 287 goto250
  141. 300 rem ** forward **
  142. 302 s=s+1
  143. 305 ift=35ands>16thenaa$="off":s=16:return
  144. 310 bq=20
  145. 320 ift<18thengosub332:goto325
  146. 321 ift<25thengosub334:goto325
  147. 322 ift<31thengosub336:goto325
  148. 323 ift<41thengosub338:goto325
  149. 325 goto125
  150. 332 ifs>20thent=t+1:s=0
  151. 333 return
  152. 334 ifs>18thent=t+1:s=0
  153. 335 return
  154. 336 ifs>17thent=t+1:s=0
  155. 337 return
  156. 338 ifs>16thent=t+1:s=0
  157. 339 return
  158. 340 rem ** backward **
  159. 341 s=s-1
  160. 342 ift=1ands<0thens=s+1:return
  161. 345 ift<19thengosub352:goto350
  162. 346 ift<26thengosub354:goto350
  163. 347 ift<32thengosub356:goto350
  164. 348 ift<36thengosub358:goto350
  165. 350 goto130
  166. 352 ifs<0thent=t-1:s=20
  167. 353 return
  168. 354 ifs<0thent=t-1:s=18
  169. 355 return
  170. 356 ifs<0thent=t-1:s=17
  171. 357 return
  172. 358 ifs<0thent=t-1:s=16
  173. 359 return
  174. 400 rem clear bottom window
  175. 405 forx=10to25:poke781,x:sys59903:nextx
  176. 410 return
  177. 450 rem * next track and sector *
  178. 452 ifpeek(1028)=0thenreturn
  179. 454 ifpeek(1028)>35thenreturn
  180. 456 ifpeek(1029)>22thenreturn
  181. 458 t=peek(1028):s=peek(1029):goto125
  182. 500 rem ** auto mode **
  183. 505 gosub400:gosub560:gosub520
  184. 510 geta$:ifa$=""then510
  185. 512 ifa$="f"ora$="[198]"then530
  186. 514 ifa$="b"ora$="[194]"then540
  187. 516 ifa$="n"ora$="[206]"then550
  188. 518 ifa$="x"ora$="[216]"thengosub400:goto225
  189. 519 goto510
  190. 520 rem update
  191. 522 print"[144][212]rack";t;"[157] [211]ector";s;"[157]  ":print""
  192. 524 print"[206]ext [212]rack, [211]ector        [157][157][157][157][157][157][157][157]";peek(1028);peek(1029);"    "
  193. 526 return
  194. 530 rem auto forward
  195. 532 geta$:ifa$="f"ora$="[198]"then500
  196. 534 gosub300:gosub520
  197. 535 if e<>1thengosub560
  198. 536 goto532
  199. 540 rem auto backward
  200. 542 geta$:ifa$="b"ora$="[194]"then500
  201. 544 gosub340:gosub520
  202. 545 if e<>1thengosub560
  203. 546 goto542
  204. 550 rem auto next
  205. 552 geta$:ifa$="n"ora$="[206]"then500
  206. 553 tt=t:ss=s
  207. 554 gosub520:t=peek(1028):s=peek(1029)
  208. 556 if t=0thent=tt:s=ss:gosub520:goto500
  209. 557 gosub450:ife<>1then500
  210. 558 goto550
  211. 560 print""
  212. 565 print"         auto mode"
  213. 570 print"[198]-for